const router = require('koa-router')();
const hotel = require('../modules/hotel');
//获取数据
router.get('/city/hotel',async(ctx,next) => {
    ctx.body = await hotel.getHotel();
})
//增加数据
router.post('/city/hotel',async(ctx,next) => {
    ctx.body = await hotel.addHotel(ctx.request.body);
})
//删除数据
router.delete('/city/hotel/:pubID/:cityID',async(ctx,next) => {
    ctx.body = await hotel.deleteHotel(ctx.params);
})
//更改数据
router.put('/city/hotel',async(ctx,next)=>{
    ctx.body = await hotel.putHotel(ctx.request.body)
})

module.exports = router;